#!/usr/bin/python
import cgi
import cgitb; cgitb.enable()

content_plain = "Content-Type:text/plain\n\n"
content_html = "Content-Type:text/html\n\n"

class Renderer:
	def __init__(self):
		self.content_type=content_html
	#can be substituted in a new thing.

	def render_function(self,x): print(x)
		
	def start(self):
		self.render_function(self.content_type)

	def end(self):
		self.render_function("")

	def write(self,outp):
		self.render_function(outp)

	def write_unsafe(self,outp):
		self.render_function(cgi.escape(outp))
		


